TABLE.RESET Function

Syntax

as P = Reset(C tablename[,N file_open_mode|SQL::Arguments args[,C alias[,C encryption key]]])

Arguments

tablename

The table file's path and name. The .DBF file extension is automatically added to the filename if you do not specify a file extension. To open a set, you must supply the .SET extension.

file_open_mode|SQL

Optional. Determines the access privileges that apply to the open table file. You can use one of the following system variables:

Variable
Function
FILE_RO_EXCLUSIVE

Read Only (Exclusive)

FILE_RW_EXCLUSIVE

Read or Write (Exclusive)

FILE_RO_SHARED

Read Only (Shared)

FILE_RW_SHARED

Read or Write (Shared)

alias

Optional. Specifies the alias that the table will have. By default, the table alias is automatically derived from the table name. For example, if the table name is "customer", the first instance of the table that is opened will have an alias of "customer", the second instance will have an alias of "customer0" and so on. It is rare that you would need to specify a specific alias for a table when opening it. If you specify a NULL Alias, Alpha Anywhere automatically computes the alias name.

encryption

Optional. Only needed if the table has been encrypted, and the default encryption key has not been set (using the DEFAULT_ENCRYPTION_KEY_SET() function), of if the table was encrypted using a different encryption key than the default encryption key.

Description

Open the primary table for the session.

Discussion

The TABLE.RESET() method changes a session's primary table to a different table as specified by Filename. Returns , a pointer to the table that is opened. If Filename refers to a set, references the parent table of the set. Note : The TABLE.RESET() method should only be used in the Interactive window to set the primary table of the Interactive window session. Using TABLE.RESET()in a script attached to an event or button on a form could cause unpredictable results because the table on which the form is based must be the primary table of the session.

Example

This code, executed in the Interactive window, sets the primary table for the Interactive window session to the Customer table.

tbl = table.reset("c:\a5\a_sports\customer.dbf")
table_name = tbl.name_get()
trace.writeln("The current table or set is now: " + table_name)

See Also